package com.wyd.singleton;

/**
 * @author Yudi Wang
 * @date 2022/1/27 15:10
 */
public class main {
    public static void main(String[] args) {
        SingletonA singletonA1 = SingletonA.getInstance();
        SingletonA singletonA2 = SingletonA.getInstance();
        System.out.println(singletonA1 == singletonA2 ? "SingletonA 单例" : "SingletonA 非单例");

        SingletonB singletonB1 = SingletonB.getInstance();
        SingletonB singletonB2 = SingletonB.getInstance();
        System.out.println(singletonB1 == singletonB2 ? "SingletonB 单例" : "SingletonB 非单例");

        SingletonC singletonC1 = SingletonC.getInstance();
        SingletonC singletonC2 = SingletonC.getInstance();
        System.out.println(singletonC1 == singletonC2 ? "SingletonC 单例" : "SingletonC 非单例");
    }
}